﻿<form method="post" data-ajax-success="OnSuccess" data-ajax="true" action="/home/changepwd">
<div class="sk-ui-box">
    <div class="header">
        <div class="title">
            修改密码
        </div>
        <div class="extra text-info">
            <p>
                密码长度6-18位，包含至少1个特殊字符，2个数字，2个字母</p>
        </div>
    </div>
    <div class="container">
        <div class="sk-ui-form-default w-450">
            <ul>
                <li>
                    <label>
                        原 密 码：
                    </label>
                    <input type="text" name="oldpwd" data-val-length-min="6" data-val-length-max="18"
                        maxlength="18" class="sk-ui-input" data-val="true" data-val-required="请输入您的原密码！"
                        data-val-length="xxx！" />
                    <span class="field-validation-error" data-valmsg-for="oldpwd" data-valmsg-replace="true">
                    </span></li>
                <li>
                    <label>
                        新 密 码：
                    </label>
                    <input type="text" id="newpwd" name="newpwd" data-password="true" maxlength="18"
                        class="sk-ui-input" data-val="true" data-val-required="请输入您的新密码！" data-val-password="不符合密码规则！" />
                    <span class="field-validation-error" data-valmsg-for="newpwd" data-valmsg-replace="true">
                    </span></li>
                <li>
                    <label>
                        确认密码：
                    </label>
                    <input type="text" name="confirmpwd" maxlength="18" class="sk-ui-input" data-val="true"
                        data-val-required="请输入确认密码！" data-password="true" data-val-password="不符合密码规则！"
                        data-val-equalto="两次输入密码不一致！" data-val-equalto-other="newpwd" />
                    <span class="field-validation-error" data-valmsg-for="confirmpwd" data-valmsg-replace="true">
                    </span></li>
            </ul>
        </div>
    </div>
    <div class="footer">
        <ul class="clearfix  mr-10">
            <li>
                <button type="submit" class="sk-ui-btn sk-ui-btn-alpha">
                    提 交</button></li><li>
                        <button type="reset" class="sk-ui-btn sk-ui-btn-beta">
                            重 置
                        </button>
                    </li>
        </ul>
    </div>
</div>
</form>
<script type="text/javascript">
    $(function () {
        $.validator.unobtrusive.parse($('form'));
    });
    function OnSuccess(result) {
        if (result.Status) {

        }
        else {
            var data = result.Data;
            var message = result.Message;
            $('span[data-valmsg-for="' + data + '"]').html(message).show();
        };
    }
</script>
